home *** CD-ROM | disk | FTP | other *** search
/ SGI Varsity Update 1998 August / SGI Varsity Update 1998 August.iso / docs6.4 / relnotes / c_fe / ch6.z / ch6
Text File  |  1998-07-29  |  14KB  |  594 lines

  1.  
  2.  
  3.  
  4.                                                - 1 -
  5.  
  6.  
  7.  
  8.                     7.2.1 ANSI C Front-End Release Notes
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.                                                - 2 -
  69.  
  70.  
  71.  
  72.                     DDDDooooccccuuuummmmeeeennnntttt NNNNuuuummmmbbbbeeeerrrr 000000007777----1111666655559999----000011110000
  73.  
  74.  
  75.                     6.  _B_u_g__F_i_x_e_s
  76.  
  77.                     This chapter details bugs that have been fixed
  78.                     both for 7.2.1 and 7.2.
  79.  
  80.  
  81.                     6.1  _B_u_g__F_i_x_e_s__i_n__M_I_P_S_p_r_o__7_._2_._1
  82.  
  83.                     This section briefly describes the bugs that
  84.                     have been fixed in the compiler since release
  85.                     7.1.  Some of the headings are followed by a
  86.                     Silicon Graphics incident report number.
  87.  
  88.                        +o The IRIX sendmail program would produce
  89.                          incorrect results when compiled -O2. This
  90.                          has been fixed. (Bug 524374).
  91.  
  92.                        +o Incorrect expression evaluation of unsigned
  93.                          subtraction
  94.  
  95.                          The following program produces incorrect
  96.                          results for the first comparison when
  97.                          compiled -n32, and -64 with 7.2. -32
  98.                          compiles are OK.
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.                                                - 3 -
  135.  
  136.  
  137.  
  138.                          %cat JJ.c
  139.  
  140.                          typedef unsigned long fakelong;
  141.  
  142.                          #define SUBTRACT(p,q)   ((fakelong)(p) - (fakelong)(q))
  143.  
  144.                          main() {
  145.  
  146.                            char *a = "a";
  147.                            char *b = "b";
  148.                            char *c = "c";
  149.  
  150.                            /* the following comparison will compare a very large number and
  151.                               a small number.  */
  152.  
  153.                            if ((SUBTRACT(a,b)) <= (SUBTRACT(c,b))) {
  154.                              printf("You have incorrectly evaluated this expression.0);
  155.                            } else {
  156.                              printf("You have correctly evaluated this expression.0);
  157.                            }
  158.  
  159.                            printf("a is 0x%x  0, (fakelong)(a));
  160.                            printf("b is 0x%x  0, (fakelong)(b));
  161.                            printf("c is 0x%x  0, (fakelong)(c));
  162.  
  163.                            printf("diff a-b is 0x%x  0, (SUBTRACT(a,b)));
  164.                            printf("diff c-b is 0x%x  0, (SUBTRACT(c,b)));
  165.  
  166.                            if ( ( (unsigned) 0 - (unsigned) 8 ) <= ((unsigned) 16 - (unsigned) 8) ) {
  167.                              printf("You have incorrectly evaluated this expression.0);
  168.                            } else {
  169.                              printf("You have correctly evaluated this expression.0);
  170.                            }
  171.                          }
  172.  
  173.                          This has been fixed (Bug 536075).
  174.  
  175.  
  176.                        +o Limit on number of files which could be
  177.                          compiled from one cc command line when
  178.                          floating licenses were used
  179.  
  180.                          The C compiler would stop and issue the
  181.                          following warnings when trying to compile
  182.                          more files than the open file descriptor
  183.                          limit on a single command line under
  184.                          floating licensing.
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.                                                - 4 -
  201.  
  202.  
  203.  
  204.                          For Example:
  205.                             (Floating Licenses being used)
  206.  
  207.                          %limit descriptors
  208.                          descriptors     200
  209.  
  210.                          %cc  *.c          (more than 200 .c files in current directory)
  211.                          file196.c:
  212.                          cc: Error: can't create output file: /tmp/ctmpa001YG
  213.                             : Too many open files
  214.  
  215.  
  216.                          This has been fixed (Bug 556876).
  217.  
  218.  
  219.  
  220.  
  221.                     6.2  _B_u_g__F_i_x_e_s__i_n__M_I_P_S_p_r_o__7_._2
  222.  
  223.                     This section briefly describes the bugs that
  224.                     have been fixed in the compiler since release
  225.                     7.1.  Some of the headings are followed by a
  226.                     Silicon Graphics incident report number.
  227.  
  228.                        +o The following line of code was incorrectly
  229.                          being compiled under -n32 with MIPSpro 7.1
  230.  
  231.                          return ( ! !((!(error) || (*(error) == (1)))) )
  232.  
  233.                          This has been fixed (Bug 449456)
  234.  
  235.                        +o Under certain circumstances the C compiler
  236.                          would dump core with the following message:
  237.  
  238.                          Signal: Segmentation fault in Scope Setup phase.
  239.                          Error: Signal Segmentation fault in phase Scope Setup -- processing
  240.                          aborted
  241.                          cc ERROR:  /usr/lib32/cmplrs/fec died due to signal 4
  242.                          cc ERROR:  core dumped
  243.  
  244.                          This has been fixed (Bug 470114)
  245.  
  246.                        +o Incorrect code produced under optimization
  247.                          (-O2 or higher).
  248.                          The compiler incorrectly optimized the
  249.                          following code:  (A workaround was provided
  250.                          under the #ifdef OPT_BUG)
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.                                                - 5 -
  267.  
  268.  
  269.  
  270.  
  271.                              for (args = result; num_args1 != 0; num_args1--)
  272.                                  *args++ = *args1++;
  273.                          #ifdef OPT_BUG /* Workaround of compiler 7.1 bug */
  274.                              while (num_args2-- > 0)
  275.                          #else
  276.                              for (             ; num_args2 != 0; num_args2--)
  277.                          #endif
  278.                                  *args++ = *args2++;
  279.  
  280.                              return result
  281.  
  282.  
  283.                          This bug has been fixed. (Bug #428276)
  284.  
  285.                        +o Incorrect optimization under -O3.
  286.                          The following code would produce incorrect
  287.                          results when compiled under -O3:
  288.  
  289.  
  290.                          /* test1.c */
  291.                          #include <stdio.h>
  292.  
  293.                          main()
  294.  
  295.                          {
  296.                             char str[] = "1.2345";
  297.                             char *cp = str;
  298.                             char *cpe = NULL;
  299.  
  300.                             printf ("1. scp = %s, cp = %x0, cp, (unsigned int) cp);
  301.                             while (cp != cpe)
  302.                             {
  303.                                if (*cp++ == '.') break;
  304.                             }
  305.                             printf ("2. scp = %s, cp = %x0, cp, (unsigned int) cp);
  306.                          }
  307.  
  308.  
  309.  
  310.                          This has been fixed. (Bug #447872)
  311.  
  312.  
  313.                        +o Incorrect optimization under -O3.
  314.                          The following code would produce incorrect
  315.                          results when compiled under -O3:
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.                                                - 6 -
  333.  
  334.  
  335.  
  336.                          /* test1.c */
  337.                          #include <stdio.h>
  338.  
  339.                          main()
  340.  
  341.                          {
  342.                             char str[] = "1.2345";
  343.                             char *cp = str;
  344.                             char *cpe = NULL;
  345.  
  346.                             printf ("1. scp = %s, cp = %x0, cp, (unsigned int) cp);
  347.                             while (cp != cpe)
  348.                             {
  349.                                if (*cp++ == '.') break;
  350.                             }
  351.                             printf ("2. scp = %s, cp = %x0, cp, (unsigned int) cp);
  352.                          }
  353.  
  354.  
  355.  
  356.                          This has been fixed. (Bug #447872)
  357.  
  358.  
  359.                        +o Improper handling of __return_address
  360.                          The following code gets incorrectly
  361.                          compiled -n32 because the reference to
  362.                          __return_address causes the return address
  363.                          from buggy to be retrieved with incorrect
  364.                          sign extension.
  365.  
  366.                              void buggy() { bar(__return_address); }
  367.  
  368.                          This has been fixed. (Bug #460589)
  369.  
  370.                        +o INTERNAL ERROR when compiling C code with
  371.                          #pragma numthreads.
  372.                          The following example illustrates an
  373.                          INTERNAL ERROR in /usr/lib32/cmplrs/be:
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.                                                - 7 -
  399.  
  400.  
  401.  
  402.                          %cc -mp -O3 -xansi -64 -mips4 -TENV:X=1 -OPT:alias=restrict -c file.c
  403.  
  404.  
  405.                          ### Compiler Error in file irvcc2.c during MP Lowering phase:
  406.                          ### out of context pragma (NUMTHREADS) in MP processing
  407.                          cc INTERNAL ERROR:  /usr/lib32/cmplrs/be returned non-zero status 1
  408.  
  409.                          %cat file.c
  410.                          void
  411.                          fored (int *rmatbeg, int *rmatind, double *rmatval, int *rmatend,
  412.                          int rows, int cols, double *y, double *x, int maxthreads)
  413.                          {
  414.  
  415.                          int     i, j, j1, k, l;
  416.                          double  temp;
  417.  
  418.                             if ( mpc_in_parallel_region() )  maxthreads = 1;
  419.                          #pragma  parallel
  420.                          #pragma  numthreads (min=1;max=maxthreads)
  421.                          #pragma  shared (rmatbeg, rmatend, rmatind, rmatval, y, x, rows)
  422.                          #pragma  local (i, k, l, temp)
  423.                             {
  424.                          #pragma  pfor iterate(i=0;rows;1) schedtype(gss)
  425.                                for (i = 0; i < rows; i++) {
  426.                                   temp = 0.0;
  427.                                   l = rmatend[i];
  428.                          #pragma ivdep
  429.                                   for (k = rmatbeg[i]; k < l; k++) {
  430.                                      temp += rmatval[k]*x[rmatind[k]];
  431.                                   }
  432.                                   y[i] = temp;
  433.                                }  /* End for loop */
  434.                             }  /* End parallel section */
  435.  
  436.                          }
  437.  
  438.                          This has been fixed. (Bug #461670)
  439.  
  440.                        +o Incorrect promotion of formal arguments.
  441.                          The following code would produce incorrect
  442.                          results when compiled -64.
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.                                                - 8 -
  465.  
  466.  
  467.  
  468.  
  469.                          #include <stdio.h>
  470.  
  471.                          int R_DIEDRE(xa,ya,za,xb,yb,zb,xc,yc,zc,xd,yd,zd)
  472.  
  473.                          float xa,ya,za;/* coord. du 1er atome */
  474.                          float xb,yb,zb;/* coord. du 2eme atome */
  475.                          float xc,yc,zc;/* coord. du 3eme atome */
  476.                          float xd,yd,zd;/* coord. du 4eme atome */
  477.                          {
  478.                           printf("%f %f %f %f %f %f %f %f %f %f %f
  479.                          %f0,xa,ya,za,xb,yb,zb,xc,yc,zc,xd,yd,zd);
  480.  
  481.                           return(0);
  482.                          }
  483.  
  484.  
  485.                          main()
  486.                          {
  487.                           float X[40],Y[40],Z[40],ang;
  488.  
  489.                           R_DIEDRE(123.4,123.4,123.4,
  490.                                    123.4,123.4,123.4,
  491.                                    123.4,123.4,123.4,
  492.                                    123.4,123.4,123.4);
  493.  
  494.                          }
  495.  
  496.  
  497.                          This has been fixed (Bug #465609).
  498.  
  499.                        +o Incorrect sign extension induced by
  500.                          optimizer
  501.                          Under certain circumstances the optimizer
  502.                          would produce code with values incorrectly
  503.                          sign extended.  This has been fixed (Bugs
  504.                          #467930 and #468670).
  505.  
  506.                        +o Assertion failure in compiler back-end.
  507.                          The following code would cause the
  508.                          compilation to fail for -n32 compiles:
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.                                                - 9 -
  531.  
  532.  
  533.  
  534.                          typedef struct bar {
  535.                              unsigned long  size;
  536.                              unsigned long  space;
  537.                          } bar;
  538.  
  539.                          typedef struct foo {
  540.                              bar      dict;
  541.                          } foo;
  542.  
  543.                          #define size(d)  ((d)->size-(d)->space)
  544.  
  545.                          void spam (foo *baz)
  546.                          {
  547.                              int flag = 1;
  548.  
  549.                              flag &= (size(&baz->dict) <= 4294967295U);
  550.                          }
  551.  
  552.                          This has been fixed (Bug #469411).
  553.  
  554.                        +o cc generates bad code when assigning to a
  555.                          variable in expression
  556.                          Under certain circumstances cc would
  557.                          generate bad code when assigning to a
  558.                          variable in an expression.  This has been
  559.                          fixed (Bug 462177).
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.